<div id="dt_<<$name>>">
<table class="dynamictable" id="dt_<<$name>>_table">
<caption><div style="display:inline;"><<$title>></div><div style="display:inline;" class="subtitle"><<$subtitle>></div></caption>
<tr>
<<section name=header loop=$headers>>
    <th class="dyntbl_<<$smarty.section.header.iteration>>"><<$headers[header]>></th>
<</section>>
    <th class="dyntbl_<<$smarty.section.header.iteration>>"><<$bottomtext>></th>
</tr>

<<$content>>
</table>
<<jqbutton id="add_<<$name>>" title="<<$buttontitle>>">>
</div>

<script>
jQuery("button#add_<<$name>>").click(function() {
    try {
        var tbl = jQuery("table#dt_<<$name>>_table");
        var cells = jQuery("table#dt_<<$name>>_table tr:nth-child(2) td");
        var rownum = jQuery("table#dt_<<$name>>_table tr").size() - 1;
        tbl.append(
            jQuery("<tr>")
                .attr("id", "newline")
        );
        createLine("<<$name>>", jQuery("tr#newline"), rownum);
        jQuery("tr#newline").attr("id", "");
    } catch (e) {
        alert(e.message);
    }
    return false;
});

</script>
